using System;
using System.ServiceModel.Channels;
using System.ServiceModel;

namespace DOJ.LEISP.LEXS.ServiceAgent
{
    public class SearchRetrieveAgent : ILEXSSearchRetrievePortType
    {
        private SearchRetrieveProxy _proxy;
        /// <summary>
        /// Initializes a new instance of the SearchRetrieveAgent class.
        /// </summary>
        public SearchRetrieveAgent()
        {
            ///_proxy = new SearchRetrieveProxy();
        }
        #region ILEXSSearchRetrievePortType Members

        public doStructuredSearchResponse doStructuredSearch(doStructuredSearchRequest request)
        {
            using (_proxy)
            {
                try
                {
                    return _proxy.doStructuredSearch(request);
                }
                catch (Exception ex)
                {
                    _proxy.Abort();
                    throw;
                }  
            }
        }

        public doStructuredSearchResponse doTextSearch(doTextSearchRequest request)
        {
            throw new NotImplementedException();
        }

        public getDataItemResponse getDataItem(getDataItemRequest request)
        {
            throw new NotImplementedException();
        }

        public getAttachmentResponse getAttachment(getAttachmentRequest request)
        {
            throw new NotImplementedException();
        }

        public getCapabilitiesResponse getCapabilities(getCapabilitiesRequest request)
        {
            throw new NotImplementedException();
        }

        public getDataOwnersResponse getDataOwners(getDataOwnersRequest request)
        {
            throw new NotImplementedException();
        }

        public getAvailabilityResponse getAvailability(getAvailabilityRequest request)
        {
            throw new NotImplementedException();
        }

        public getDomainResponse getDomain(getDomainRequest request)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
